package com.ma.server.Impl;

import com.ma.Dao.ProjectDao;
import com.ma.entity.Project;
import com.ma.server.ProjectServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ProjectName: project
 * @Package: com.ma.server.Impl
 * @ClassName: ProjectServer
 * @Author: YHHHH
 * @Description:
 * @Date: 2021/3/29 23:17
 * @Version: 1.0
 */
@Service
@Transactional
public class ProjectServerImpl implements ProjectServer {
    @Autowired
    private ProjectDao projectDao;

    @Override
    public List<Project> teacherProject(Integer teacherId) {
        List<Project> teacherProject = projectDao.teacherProject(teacherId);
        return teacherProject;
    }

    @Override
    public Integer addProject(Project project) {
        Integer integer = projectDao.addProject(project);
        return integer;
    }

    @Override
    public Project showProject(Integer id) {
        Project project = projectDao.showProject(id);
        return project;
    }

    @Override
    public List<Project> allProject(Integer id) {

        List<Project> projects = projectDao.allProject(id);
        return projects;
    }

    @Override
    public Integer findTeamId(Integer id) {

        Integer pTeamId = projectDao.findTeamId(id);
        return pTeamId;
    }

    @Override
    public Integer updateTeamId(Integer teamId,Integer projectId) {
        Integer integer = projectDao.updateTeamId(teamId,projectId);
        return integer;
    }

    @Override
    public Integer deleteProject(Integer id) {
        Integer integer = projectDao.deleteProject(id);
        return integer;

    }
}
